package aiku.numericalcontroloa.Model.Entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * 
 * @TableName payment
 */
@TableName(value ="payment")
@Data
public class Payment implements Serializable {
    /**
     * 付款id
     */
    @TableId(type = IdType.ASSIGN_UUID)
    private String paymentId;

    /**
     * 产品名称
     */
    private String goodName;

    /**
     * 产品型号
     */
    private String goodModel;

    /**
     * 产品价格(单价)
     */
    private BigDecimal goodPrice;

    /**
     * 结算金额
     */
    private BigDecimal supplierPrice;

    /**
     * 产品数量
     */
    private Integer goodNum;

    /**
     * 采购人
     */
    private String purchaserName;

    /**
     * 供应商名称
     */
    private String supplierName;

    /**
     * 采购时间
     */
    private Date storageTime;

    /**
     * 供应商id
     */
    private String supplierId;

    /**
     * 结款方式(0是全款,1是月底支付)
     */
    private String type;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Payment other = (Payment) that;
        return (this.getPaymentId() == null ? other.getPaymentId() == null : this.getPaymentId().equals(other.getPaymentId()))
            && (this.getGoodName() == null ? other.getGoodName() == null : this.getGoodName().equals(other.getGoodName()))
            && (this.getGoodModel() == null ? other.getGoodModel() == null : this.getGoodModel().equals(other.getGoodModel()))
            && (this.getGoodPrice() == null ? other.getGoodPrice() == null : this.getGoodPrice().equals(other.getGoodPrice()))
            && (this.getGoodNum() == null ? other.getGoodNum() == null : this.getGoodNum().equals(other.getGoodNum()))
            && (this.getPurchaserName() == null ? other.getPurchaserName() == null : this.getPurchaserName().equals(other.getPurchaserName()))
            && (this.getStorageTime() == null ? other.getStorageTime() == null : this.getStorageTime().equals(other.getStorageTime()))
            && (this.getSupplierId() == null ? other.getSupplierId() == null : this.getSupplierId().equals(other.getSupplierId()))
            && (this.getType() == null ? other.getType() == null : this.getType().equals(other.getType()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getPaymentId() == null) ? 0 : getPaymentId().hashCode());
        result = prime * result + ((getGoodName() == null) ? 0 : getGoodName().hashCode());
        result = prime * result + ((getGoodModel() == null) ? 0 : getGoodModel().hashCode());
        result = prime * result + ((getGoodPrice() == null) ? 0 : getGoodPrice().hashCode());
        result = prime * result + ((getGoodNum() == null) ? 0 : getGoodNum().hashCode());
        result = prime * result + ((getPurchaserName() == null) ? 0 : getPurchaserName().hashCode());
        result = prime * result + ((getStorageTime() == null) ? 0 : getStorageTime().hashCode());
        result = prime * result + ((getSupplierId() == null) ? 0 : getSupplierId().hashCode());
        result = prime * result + ((getType() == null) ? 0 : getType().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", paymentId=").append(paymentId);
        sb.append(", goodName=").append(goodName);
        sb.append(", goodModel=").append(goodModel);
        sb.append(", goodPrice=").append(goodPrice);
        sb.append(", goodNum=").append(goodNum);
        sb.append(", purchaserName=").append(purchaserName);
        sb.append(", storageTime=").append(storageTime);
        sb.append(", supplierId=").append(supplierId);
        sb.append(", type=").append(type);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}